package org.reference.generic.operator;

import org.reference.generic.base.Parameter;

/**
 * 
 */
public class Add extends Function {

    /**
     * 
     */
    public Add(Parameter[] parameters) {
    	super(parameters);
    }

	@Override
	public void operation() {
		double opResult = 0.0d;
		for (Node node : branches) {
			if(!node.isTerminal())
				((Function)node).operation();
			opResult += node.getResult();
		}
		
		setResult(opResult);
	}

}